package com.hello.sky.controller.user;


import com.hello.sky.model.vo.DishVO;
import com.hello.sky.result.Result;
import com.hello.sky.service.DishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("userDIshController")
@RequestMapping("/user/dish")
public class DishController {

    @Autowired
    private DishService dishService;

    @GetMapping("/list")
    public Result getDishWithFlavorListByCategoryId(@RequestParam("categoryId") Long id){
        List<DishVO> dishVOList = dishService.getDishWithFlavorListByCategoryId(id);
        return Result.success(dishVOList);
    }
}
